package com.huluobo.a2109kotlinshopping.home

import androidx.lifecycle.MutableLiveData
import com.huluobo.a2109kotlinshopping.base.BaseViewModel

/**
 *  Created by LC on 2024/1/11.
 */
class HomeViewModel : BaseViewModel() {
    private val repo = HomeRepo()
    val homeGoodsListSuccess = MutableLiveData<HomeGoodsBeanResult>()
    val homeGoodsListFailed = MutableLiveData<String>()

    val homeBannerSuccess = MutableLiveData<HomeBannerBeanResult>()
    val homeBannerFailed = MutableLiveData<String>()

    val homeNavSuccess = MutableLiveData<HomeNavBeanResult>()
    val homeNavFailed = MutableLiveData<String>()

    fun getHomeGoodsList(
        categoryId: Int,
        currentPage: Int,
        pageSize: Int
    ) {
        repo.getHomeGoodsList(categoryId, currentPage, pageSize, homeGoodsListSuccess, homeGoodsListFailed)
    }

    fun getHomeBanner() {
        repo.getHomeBanner(homeBannerSuccess, homeBannerFailed)
    }

    fun getHomeNav() {
        repo.getHomeNav(homeNavSuccess, homeBannerFailed)
    }
}